def wux():
    global r,x,y,o,g,t,h,t,m,cuowu,cuo
    import time,random
    r = 0
    x = 0
    y = 0
    o = 0
    g = 6   #告诉程序一共听写几次
    m = 0
    cuo = 0
    t = {}
    h = {}
    t = {}
    cuowu = {}
    yi = {'eat breakfast':'吃早饭','have...class':'上……课','play sports':'进行体育运动','exercise':'活动；运动','do morning exercises':'做早操','eat dinner':'吃晚饭','clean my room':'打扫我的房间','go for a walk':'散步','go shopping':'去买东西；购物','take':'学习；上（课）','dancing':'跳舞;舞蹈（ing形式）','take a dancing class':'上舞蹈课','when':'什么时候；何时','after':'在（时间)后','start':'开始','usually':'通常地；惯常地','Spain':'西班牙','late':'晚；迟','a.m.':'午前；上午','p.m.':'午后；下午','why':'为什么','shop':'买东西；购物','work':'工作','last':'上一个的；刚过去的','sound':'听起来好像','also':'还；也','busy':'忙的','need':'需要','play':'戏剧；剧本','letter':'信','live':'居住','island':'岛','always':'总是；一直','cave':'山洞；洞穴','go swimming':'去游泳','win':'获胜'}
    er ={'spring':'春天','summer':'夏天','autumn':'秋天','winter':'冬天','season':'季节','picnic':'野餐','go on a picnic':'去野餐','pick':'摘','pick apples':'摘苹果','snowman':'雪人','make a snowman':'堆雪人','go swimming':'去游泳','which':'哪一个','best':'最','snow':'雪','good job':'做得好','because':'因为','vacation':'假期','all':'完全','pink':'粉色','lovely':'可爱的','leaf':'叶子','fall':'落下','paint':'绘画'}
    san = {'January':'一月','February':'二月','March':'三月','April':'四月','May':'五月','June':'六月','July':'七月','August':'八月','September':'九月','October':'十月','November':'十一月','December':'十二月','few':'不多','a few':'一些','thing':'事情','meet':'集会','sports meet':'运动会','Easter':'复活节','trip':'旅行','year':'年','plant':'种植','contest':'比赛','the Great Wall':'长城','national':'国家的','National Day':'国庆日','American':'美国的','Thanksgiving':'感恩节','Christmas':'圣诞节','holiday':'节日','game':'游戏','roll':'滚动','look for':'寻找','chocolate':'巧克力','bunny':'兔子','RSVP':'请赐复','by':'在……之前'}
    si = {'first':'第一','second':'第二','third':'第三','fourth':'第四','fifth':'第五','twelfth':'第十二','twentieth':'第二十','twenty-first':'第二十一','twenty-third':'第二十三','thirtieth':'第三十','special':'特殊的','fool':'蠢人','kitten':'小猫','diary':'日记','still':'仍然','noise':'噪音','fur':'动物皮毛','open':'开着的','walk':'行走'}
    wu = {'mine':'我的','yours':'你的','his':'他的','hers':'她的','theirs':'他们的','ours':'我们的','climbing':'攀登','eating':'吃','playing':'玩','jumping':'跳','drinking':'喝','sleeping':'睡觉','each':'每个','other':'其他','each other':'相互','excited':'兴奋地','like':'像……那样'}
    liu = {'doing morning exercises':'做早操','having...class':'上……课','eating lunch':'吃午饭','reading a book':'看书','listening to music':'听音乐','keep':'保持','keep to the right':'靠右','keep your desk clean':'保持课桌干净','talk quietly':'小声讲话','turn':'顺序','take turns':'按顺序来','bamboo':'竹子','its':'它的','show':'指导，引导','anything':'任何事物','else':'另外','exhibition':'展览','say':'说；讲','have a look':'看一看','sushi':'寿司','teach':'教','sure':'当然','Canadian':'加拿大的','Spanish':'西班牙的'}
    e = {0:yi,1:er,2:san,3:si,4:wu,5:liu}
    def q(v):
        global r,x,y,o,g,t,h,t,m,cuowu,cuo
        dict_key_ls = list(v.keys())
        random.shuffle(dict_key_ls)
        new_dic = {}
        for key in dict_key_ls:
            new_dic[key] = v.get(key)
        v = new_dic
        if 'climbing' in v:
            print('这里的动词用ing形式~人称代词为名词性~')
        if 'eating lunch' in v:
            print('这个也是动词用ing形式~')
        for i in v:
            cuowu = v[i]
            q = input(cuowu+'：')
            w = i
            if q == w:
                print('对喽！')
                r += 1
            else:
                print('错啦错啦！')
                t[cuowu] = w
                x += 1
        print('结束！')
        print('一共对',r,'道，错',x,'道')
        if x != 0:
            cuo += 1
            print('\n不扎实',x,'道！巩固错题：')
            x = 0
            for i in t:
                q = input(i + '：')
                w = t[i]
                if q == w:
                    print('对喽！')
                    y += 1
                else:
                    print('错啦错啦！')
                    o += 1
                    m += 1
                    x += 1
                    h[i] = w
            print('结束！')
            print('一共对',y,'道，错',o,'道')
        r = 0
        c = 0
        y = 0
        o = 0
        x = 0
        t = {}
    for l in range(g):
        print('\n第',l+1,'单元！\n')
        v = e[l]
        q(v)
    if m != 0:
        html = open('cuowu.txt','r')
        php = html.read()
        html.close()
        go = open('cuowu.txt','a')
        print('\n错题答案：共',m,'个二错单词\n')
        for i in h:
            d = h[i]
            print(i , d)
            if i not in php or d not in php:
                go.write("'")
                go.write(i)
                go.write("'")
                go.write(':')
                go.write("'")
                go.write(d)
                go.write("'")
                go.write(',\n')
        go.close()
    time.sleep(10)